import request from '@/utils/request'
// 获取所有的面经文章
export const getArticles = (params) => {
  return request({
    url: '/admin/interview/query',
    params
  })
}

// 删除面经文章根据id
export const delArticle = id => {
  return request({
    method: 'DELETE',
    url: '/admin/interview/remove',
    data: {
      id
    }
  })
}

// 添加面经
export const addArticle = data => {
  return request({
    method: 'POST',
    url: '/admin/interview/create',
    data
  })
}

// 根据id获取面经详情
export const getArticle = id => {
  return request({
    url: '/admin/interview/show',
    params: {
      id
    }
  })
}

// get,delete -> params
// post,put,patch -> data
// 更新面经内容
export const updateArticle = data => {
  return request({
    method: 'PUT',
    url: '/admin/interview/update',
    data
  })
}
